]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
portalHelper: Rename Done signal to StatusChanged
authorMichael Catanzaro <mcatanzaro@redhat.com>
Sun, 27 Jul 2025 12:07:27 +0000 (14:07 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Sat, 13 Sep 2025 16:54:40 +0000 (18:54 +0200)
The name Done is incorrect because the result type may be RECHECK. In
this case, we are not done.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3813>
(cherry picked from commit 387911c5154fcd86b98c103ddaa365e1aa563e48)

data/dbus-interfaces/org.gnome.Shell.PortalHelper.xml
js/portalHelper/main.js
js/ui/status/network.js

index 8c6a13ebd8082d88e59eb3276c02485d4b7f58c5..dca9cca172e037e21b6578ad6a3ba595ed309750 100644 (file)
@@ -11,7 +11,7 @@
     <method name="Refresh">
       <arg name="connection" type="o" direction="in"/>
     </method>
-    <signal name="Done">
+    <signal name="StatusChanged">
       <arg type="o" name="connection"/>
       <arg type="u" name="result"/>
     </signal>
index 1a5c644dc05914970bc9a7071fde603dc0c23add..5ae536c3b6a519857bc7c71a7a950f07821e3497 100644 (file)
@@ -109,7 +109,7 @@ class PortalSecurityButton extends Gtk.MenuButton {
 
 const PortalWindow = GObject.registerClass(
 class PortalWindow extends Gtk.ApplicationWindow {
-    _init(application, url, timestamp, doneCallback) {
+    _init(application, url, timestamp, statusChangedCallback) {
         super._init({
             application,
             title: _('Hotspot Login'),
@@ -132,7 +132,7 @@ class PortalWindow extends Gtk.ApplicationWindow {
         this._uri = GLib.Uri.parse(url, HTTP_URI_FLAGS);
         this._everSeenRedirect = false;
         this._originalUrl = url;
-        this._doneCallback = doneCallback;
+        this._statusChangedCallback = statusChangedCallback;
         this._lastRecheck = 0;
         this._recheckAtExit = false;
 
@@ -181,9 +181,9 @@ class PortalWindow extends Gtk.ApplicationWindow {
 
     vfunc_close_request() {
         if (this._recheckAtExit)
-            this._doneCallback(PortalHelperResult.RECHECK);
+            this._statusChangedCallback(PortalHelperResult.RECHECK);
         else
-            this._doneCallback(PortalHelperResult.CANCELLED);
+            this._statusChangedCallback(PortalHelperResult.CANCELLED);
         return false;
     }
 
@@ -242,7 +242,7 @@ class PortalWindow extends Gtk.ApplicationWindow {
             if (uri.get_host() === CONNECTIVITY_CHECK_HOST && this._everSeenRedirect) {
                 // Yay, we got to gnome!
                 decision.ignore();
-                this._doneCallback(PortalHelperResult.COMPLETED);
+                this._statusChangedCallback(PortalHelperResult.COMPLETED);
                 return true;
             } else if (uri.get_host() !== CONNECTIVITY_CHECK_HOST) {
                 this._everSeenRedirect = true;
@@ -268,7 +268,7 @@ class PortalWindow extends Gtk.ApplicationWindow {
         if (shouldRecheck) {
             this._lastRecheck = now;
             this._recheckAtExit = false;
-            this._doneCallback(PortalHelperResult.RECHECK);
+            this._statusChangedCallback(PortalHelperResult.RECHECK);
         } else {
             this._recheckAtExit = true;
         }
@@ -358,7 +358,7 @@ class WebPortalHelper extends Adw.Application {
             return;
 
         top.window = new PortalWindow(this, top.url, top.timestamp, result => {
-            this._dbusImpl.emit_signal('Done', new GLib.Variant('(ou)', [top.connection, result]));
+            this._dbusImpl.emit_signal('StatusChanged', new GLib.Variant('(ou)', [top.connection, result]));
         });
     }
 });
index 7e06775d7b3725de6525eb52600cdbfa4b823fb7..c411afec0d6b92d74b512c7da8f6b4a35dbed27b 100644 (file)
@@ -2015,7 +2015,7 @@ class CaptivePortalHandler extends Signals.EventEmitter {
         Main.panel.closeCalendar();
     }
 
-    _portalHelperDone(parameters) {
+    _portalHelperStatusChanged(parameters) {
         const [path, result] = parameters;
 
         if (result === PortalHelperResult.CANCELLED) {
@@ -2041,9 +2041,9 @@ class CaptivePortalHandler extends Signals.EventEmitter {
                 g_interface_name: PortalHelperInfo.name,
                 g_interface_info: PortalHelperInfo,
             });
-            this._portalHelperProxy.connectSignal('Done',
+            this._portalHelperProxy.connectSignal('StatusChanged',
                 (proxy, emitter, params) => {
-                    this._portalHelperDone(params);
+                    this._portalHelperStatusChanged(params);
                 });
 
             try {